import Model from '../lib/model';
import * as  chai from 'chai';
import User from '../server/models/User';

let expect = chai.expect;

describe('核心库测试', function() {
  it('新建一个对象', function() {
      const model = new Model({
          tableName: "User",
          fields:{
              "username:string": {}
          }
      });
    expect(model.getTableName()).to.be.equal("User");
  });

  it('新建一个User对象', function() {
        const user = new User();
        expect(user.getTableName()).to.be.equal("User");
  });

  it('新建一个用户，用户名是testuser, 密码是123666', function() {
    const user = new User();
    user.put("username", "testUser");
    user.put("password", "123666");
    expect(user.getTableName()).to.be.equal("User");
  });

});